<!--
 * @Author: Aaron
 * @Date: 2022-05-06 14:36:18
 * @LastEditors: Aaron
 * @LastEditTime: 2022-05-12 10:29:31
 * @Description: file content
 * @FilePath: \ias_ui\src\views\JDSupermarket\components\search.vue
 * @Company: 沃尔玛
-->
<template>
  <el-form class="searchform" :inline="true" size="mini" label-width="auto">
    <!-- <el-form-item label="选择门店">
      <el-cascader
        v-model="searchData.sss"
        style="width: 200px"
        placeholder="请选择门店"
        :props="{ children: 'children', label: 'categoryName', expandTrigger: 'hover', value: 'categoryId' }"
        :options="options"
        separator=">"
        filterable
        clearable
      />
    </el-form-item> -->

    <el-form-item label="店号">
      <el-input v-model="searchData.storeNbrList" type="textarea" placeholder="请输入店号，多个回车换行隔开" clearable style="width: 200px" />
    </el-form-item>

    <el-form-item>
      <el-button size="mini" type="primary" icon="el-icon-search" round @click="handleSearch">查 询</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { queryOptions } from '@/api/JDSupermarket/productsList.js'

export default {
  name: 'Search',
  props: {
    searchData: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      options: []
    }
  },
  created() {
    // this.queryOptions()
  },
  methods: {
    async queryOptions() {
      const { code, result } = await queryOptions()
      if (code !== '0' || !Array.isArray(result)) return
      this.options = result
    },

    handleSearch() {
      this.$emit('handleSearch')
    }
  }
}
</script>

<style></style>
